<HTML><HEAD><TITLE>/home/steder/PythonLectures/BobChat-v0.3/BobClient.py</TITLE></HEAD>
                  <BODY BGCOLOR=#FFFFFF>
                  <!--header-->
                  <!--script--><PRE><FONT COLOR=#1111CC># Example of some needlessly complicated loops and other control</FONT>
<FONT COLOR=#1111CC># structures to illustrate how indentation is used to make</FONT>
<FONT COLOR=#1111CC># blocks of code.</FONT>
<FONT COLOR=#1111CC># Indentation works like { and } in C or Java.</FONT>

<FONT COLOR=#3333CC><B>if</B></FONT> <FONT COLOR=#115511>"hello"</FONT> == <FONT COLOR=#115511>"world"</FONT>: <FONT COLOR=#1111CC>#Colons are used at the end of control statements a lot</FONT>
    <FONT COLOR=#1111CC># Notice the indent here</FONT>
    <FONT COLOR=#3333CC><B>print</B></FONT> <FONT COLOR=#115511>"hello"</FONT> + <FONT COLOR=#115511>"world"</FONT> + <FONT COLOR=#115511>"!!!"</FONT>
<FONT COLOR=#3333CC><B>elif</B></FONT> type(a) == type(1):
    newlist = []
    <FONT COLOR=#3333CC><B>while</B></FONT> a &lt; 100: <FONT COLOR=#1111CC># Everything below here is part of this while</FONT>
        list.append(a)
        <FONT COLOR=#3333CC><B>for</B></FONT> value <FONT COLOR=#3333CC><B>in</B></FONT> list: <FONT COLOR=#1111CC># Everything below here is part of this for</FONT>
            <FONT COLOR=#3333CC><B>try</B></FONT>:
                newlist.append[math.sqrt(value)]
            <FONT COLOR=#3333CC><B>except</B></FONT>:
                <FONT COLOR=#3333CC><B>print</B></FONT> <FONT COLOR=#115511>"crap!  value just happened to be negative!!!"</FONT>
                <FONT COLOR=#3333CC><B>print</B></FONT> <FONT COLOR=#115511>"I'm melting!"</FONT>
        <FONT COLOR=#1111CC># The for loop ends here</FONT>
        a += 1
    <FONT COLOR=#1111CC># The while loop ends here</FONT>
    <FONT COLOR=#3333CC><B>print</B></FONT> newlist
<FONT COLOR=#1111CC># The if else structure (and in this case, the "program") ends here.</FONT>

</PRE>
                  <!--footer-->
                  </BODY>
